﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace XWord.WPF.ApplicationFramework
{
    public class FrameworkElementService
    {

        public static ActionCondition GetUnLoadedCondition(DependencyObject obj)
        {
            return (ActionCondition)obj.GetValue(UnLoadedConditionProperty);
        }

        public static void SetUnLoadedCondition(DependencyObject obj, ActionCondition value)
        {
            obj.SetValue(UnLoadedConditionProperty, value);
        }

        public static readonly DependencyProperty UnLoadedConditionProperty =
            DependencyProperty.RegisterAttached("UnLoadedCondition", typeof(ActionCondition), typeof(FrameworkElementService), 
            new UIPropertyMetadata(null));



        public static bool GetIsFirstVisit(DependencyObject obj)
        {
            return (bool)obj.GetValue(IsFirstVisitProperty);
        }

        public static void SetIsFirstVisit(DependencyObject obj, bool value)
        {
            obj.SetValue(IsFirstVisitProperty, value);
        }

        public static readonly DependencyProperty IsFirstVisitProperty =
            DependencyProperty.RegisterAttached("IsFirstVisit", typeof(bool), typeof(FrameworkElementService), 
            new UIPropertyMetadata(true));

        
    }
}
